//
//  AppDelegate.swift
//  pgy
//
//  Created by vsccw on 2018/12/28.
//  Copyright © 2018 vsccw.com. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
  
  var window: UIWindow?
  
  
  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    
    BackgroundFetch.shared.setupBackgroundFetchTimeInterval(1 * 60) // 10分钟获取一次
    _ = RepeatFetch.shared
    
    LocalNotification.shared.requestPersimission()
    LocalNotification.shared.resetBadge()
    
    return true
  }
  
  func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
    BackgroundFetch.shared.fetch(completionHandler)
  }
  
}

